package com.xc.controller;


import com.xc.common.ServerResponse;
import com.xc.service.ISiteBannerService;
import com.xc.service.ISiteInfoService;
import com.xc.service.ISitePayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author mipha
 * @version 1.0
 * @date 2019/3/17 11:49 AM
 */
@Controller
@RequestMapping("/api/site/")
@Slf4j
public class SiteApiController {

    @Autowired
    ISiteBannerService iSiteBannerService;
    @Autowired
    ISiteInfoService iSiteInfoService;
    @Autowired
    ISitePayService iSitePayService;


    /**
     *  获取banner图
     * @param platType
     * @return
     */
    @RequestMapping("getBannerByPlat.do")
    @ResponseBody
    public ServerResponse getBannerByPlat(String platType){
        return iSiteBannerService.getBannerByPlat(platType);
    }


    /**
     *  获取基本信息
      */
    @RequestMapping("getInfo.do")
    @ResponseBody
    public ServerResponse getInfo(){
        return iSiteInfoService.getInfo();
    }

    /**
     *  获取支付渠道
      * @return
     */
    @RequestMapping("getPayInfo.do")
    @ResponseBody
    public ServerResponse getPayInfo(){
        return iSitePayService.getPayInfo();
    }

    /**
     *  根据id获取渠道的详细信息
     * @param payId
     * @return
     */
    @RequestMapping("getPayInfoById.do")
    @ResponseBody
    public ServerResponse getPayInfoById(Integer payId){
        return iSitePayService.getPayInfoById(payId);
    }




}
